package com.zjuh.goodboy.index;

import java.util.Collection;
import java.util.Iterator;

import com.zjuh.goodboy.items.Item;

public class DataProviderMock implements DataProvider {

	private Collection<Item> items;
	
	public DataProviderMock(Collection<Item> items) {
		this.items = items;
	}
	
	private Iterator<Item> iterator;
	
	@Override
	public void destroy() {
		iterator = null;
	}

	@Override
	public boolean hasNext() {
		return iterator.hasNext();
	}

	@Override
	public void init() {
		iterator = items.iterator();
	}

	@Override
	public Item next() {
		return iterator.next();
	}

}
